package com.linln.modules.member.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.linln.modules.system.domain.User;

import lombok.Data;

/**
 * 代理商提现表
 * @author hct
 * @date 2019/09/12
 */
@Data
@Entity
@Table(name="member_agent_money")
@EntityListeners(AuditingEntityListener.class)
public class MemberAgentMoney implements Serializable {
    // 主键ID
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;
    // 用户id
    @ManyToOne(fetch=FetchType.LAZY)
    @NotFound(action=NotFoundAction.IGNORE)
    @JoinColumn(name="memberagent_id")
    private MemberAgent memberagent;
  
    
    
    private String area;
    private String areaName;
    //申请提现的额度
    private Double curmoney;
    //提现前有多少余额
    private Double  premoney;
    //提现后还剩多少余额
    private Double aftermoney;
    //申请提现价格 0代表申请 1代表同意 2代表拒绝
    private Integer status;
    //审批人
    @CreatedBy
    @ManyToOne(fetch=FetchType.LAZY)
    @NotFound(action=NotFoundAction.IGNORE)
    @JoinColumn(name="create_by")
    @JsonIgnore
    private User user;//
    
    //支付金额价格
    private Double paymoney;
    //支付金额时间
    private Date paymoneyDate;
    
    // 创建时间
    @CreatedDate
    private Date createDate;
    // 更新时间
    @LastModifiedDate
    private Date updateDate;


    private String reasondesc;
    //平台分的钱（扣除0.6%的）
    private Double ownermoney;

    /**
     * 申请提现的订单号
     */
    //订单编号
    private String orderCode;


}